﻿using System;
using System.ServiceModel;
using WebChatApi.Common;
using WebChatApi.Common.LightAccessControl;

namespace WebChatApi.Common.Interface
{
    /// <summary>
    /// Abstract interface for Base Messaging Service
    /// </summary>
    /// <typeparam name="T">Messaging object.</typeparam>
    [ServiceContract]
    public interface IBaseMessagingService<T>
    {
        /// <summary>
        /// Sends the specified messaging object.
        /// </summary>
        /// <param name="request">The request contains messaging object.</param>
        /// <returns>MessagingResponse.</returns>
        [OperationContract]
        MessagingResponse Send(AccessLicenseBasedServiceRequest<T> request);

        /// <summary>
        /// Tracks the by key.
        /// </summary>
        /// <param name="request">The request contains messaging object.</param>
        [OperationContract]
        void TrackByKey(AccessLicenseBasedServiceRequest<Guid> request);

        /// <summary>
        /// Services the status.
        /// </summary>
        /// <param name="license">The license.</param>
        /// <returns>System.String.</returns>
        [OperationContract]
        string ServiceStatus(AccessLicense license);

        /// <summary>
        /// Starts this instance.
        /// </summary>
        void Start();

        /// <summary>
        /// Stops this instance.
        /// </summary>
        void Stop();
    }
}
